import {Product} from "../entity/product";
import {Injectable} from "@angular/core";
import {Http, Response} from "@angular/http";
import {Observable} from "rxjs/Rx";
/**
 * Created by Administrator on 2016/8/3.
 */
@Injectable()//当前组件可被依赖注入
export  class ProductService{
    private http:Http;//Http是模块,不是协议
    constructor(_http:Http){
        this.http=_http;

    }
    getProduct():Observable<Response>{
        let url="http://localhost:8888/demo-server/product/list.action";

        return this.http.request(url);

    }
}
